<template>
    <!-- 修改资料 -->
    <div>
        <el-form label-width="75px" :model="form" label-position="right" ref="formRef" :rules="formRules" disabled class="borderNone">
            <el-row>
                <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
                    <el-form-item label="编号">
                        <el-input v-model="form.number"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
                    <el-form-item label="名称" prop="name">
                        <el-input v-model="form.name"></el-input>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
                    <el-form-item label="属性类型">
                        <el-input v-model="form.propTypeName"></el-input>
                    </el-form-item>
                </el-col>
                <el-col :xs="24" :sm="24" :md="24" :lg="12" :xl="12">
                    <el-form-item label="状态" prop="status">
                        <el-switch v-model="form.status" size="large" inline-prompt :active-icon="Check"
                            :inactive-icon="Close" active-value="normal" inactive-value="disable" />
                    </el-form-item>
                </el-col>
            </el-row>
            <sc-title title="属性值列表"></sc-title>
            <el-scrollbar height="200px">
                <ts-form-table v-model="dataList" disabled placeholder="暂无数据">
                    <template #tableContent>
                        <el-table-column prop="number" label="字段名">
                        </el-table-column>
                        <el-table-column prop="name" label="字段描述">
                        </el-table-column>
                        <el-table-column prop="itemIndex" label="顺序">
                        </el-table-column>
                        <el-table-column label="状态">
                            <template #default="scope">
                                <el-switch v-model="scope.row.status" size="large" inline-prompt :active-icon="Check"
                                    :inactive-icon="Close" active-value="normal" inactive-value="disable" />
                            </template>
                        </el-table-column>
                        <el-table-column label="备注" prop="remark">
                        </el-table-column>
                    </template>
                </ts-form-table>
            </el-scrollbar>
        </el-form>
        <div class="button-position" ref="button">
            <el-button @click="updateVisible">取 消</el-button>
        </div>
    </div>
</template>

<script setup>
import { reactive, ref, onMounted } from 'vue';
import { Check, Close } from '@element-plus/icons-vue';
import { ElNotification } from 'element-plus';
import Api from '@/api/model/pm.js'
import tsFormTable from '@/components/scFormTable/index.vue'
const emit = defineEmits(['updatetable'])
// 添加用户数据的对象
const form = ref({});
const formRef = ref(null);
const dataList = ref([])
const props = defineProps({
    paramsData: {
        type: Object,
        defalut: {}
    }
})
onMounted(() => {
    getInit()
})
const getInit = async () => {
    var res = await Api.prop.detail.post(props.paramsData);
    console.log(res)
    if (res.code == 200) {
        form.value = res.data
        dataList.value = res.dataList
    }
}
const restAddFormData = () => {
    formRef.value.resetFields();
}

const updateVisible = (val) => {
    emit('updatetable')
}




</script>

<style lang="less" scoped>
.borderNone {
    :deep(.el-input__wrapper) {
        box-shadow: 0 0 0 0px var(--el-input-border-color, var(--el-border-color)) inset;
        cursor: default;
        background-color: transparent; //背景颜色透明
        border-bottom: 1px solid #999;
        border-radius: 0;

        .el-input__inner {
            cursor: default !important;
        }
    }
}
</style>

